import Vue from 'vue'

import VueRouter from 'vue-router'

// import Home from "../views/home/Home.vue";
// import Classify from "../views/classify/Classify.vue";
// import Discovery from "../views/discovery/Discovery.vue"
// import ShoppingCar from "../views/shoppingCar/ShoppingCar.vue"
// import Mine from "../views/mine/Mine.vue"
// 引用路由插件
Vue.use(VueRouter)

// 路由表
const routes = [
  {
    path:'/',
    redirect:'/home'
  },
  {
    path: '/home',
    component: ()=>import("../views/home/Home.vue")
  },
  {
    path: '/classify',
    component: ()=>import("../views/classify/Classify.vue"),
    children:[
      {
        name:"classifychild",
        path:'classifychild/:id',
        component: ()=>import("../views/classify/ClassifyChild.vue")
      },
      {
        path:'goodsinfo/:id',
        component: ()=>import("../views/classify/GoodsInfo.vue")
      },
    ]
  },
  
  {
    path: '/discovery',
    component: ()=>import("../views/discovery/Discovery.vue")
  },
  {
    path: '/shoppingcar',
    component: ()=>import("../views/shoppingCar/ShoppingCar.vue")
  },
  {
    path: '/mine',
    component: ()=>import("../views/mine/Welcome.vue"),
    children:[
      {
        path:'login',
        component: ()=>import("../views/mine/Login.vue")
      },
    ]
  },
  {
    path: '/search',
    component: ()=>import("../views/search/search.vue")
  },
  
]

const router = new VueRouter({
  mode: 'history',// 模式 hash, history
  routes
})

export default router